﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using WhatCatch.Core2.Domain;

namespace WhatCatch.Core2.Repository
{
    public class DataContext : DbContext
    {
        public DataContext(DbContextOptions options)
             : base(options)
        {

        }

        public DataContext()
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer("Data source=.;Initial Catalog=WhatCatchDB;Trusted_Connection=true", b => b.UseRowNumberForPaging());
        }

        public DbSet<CrawlerPlan> CrawlerPlan { get; set; }
        public DbSet<CrawlerPlanConfig> CrawlerPlanConfig { get; set; }
        public DbSet<CrawlerPlanRecord> CrawlerPlanRecord { get; set; }
        public DbSet<CrawlerPlanTask> CrawlerPlanTask { get; set; }
        public DbSet<CrawlerPlanTaskRecord> CrawlerPlanTaskRecord { get; set; }
        public DbSet<CrawlerPlanTaskHistory> CrawlerPlanTaskHistory { get; set; }

    }
}
